Repository navigation
fix(web,mobile): thread setting changes no longer end background work from the client - #40846
juliusmarminge wants to merge 7 commits into
Conversation
…ode, instance and worktree changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and shells Changing runtime mode, provider instance, or worktree detached the provider session even while its process ran the thread's background agents and shells, so that work died silently and the UI kept showing it as running (#16000). The orchestrator now asks the live adapter whether a session the change would detach still has this thread's background work, and refuses the change with a retryable message instead. Archive, settle, and Stop still end the work. The web branch picker no longer stops the session itself before a worktree change; the server already detaches on that path, and the eager stop bypassed the guard. Mobile outbox settings sync now uses a command id per retry attempt, so a refused change can apply once the work finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd work on account changes Exclusive sessions now ask the whole session for background work, since Claude's thread probe sees shells but not native background Agents. A send or queued send that would continue the native thread on another account refuses while that work runs, like the settings changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ueue A queued send refused because background work was still running was classed as an unknown provider failure, so the next queued message held the whole queue and nothing released it. The refusal is now a validation failure: only that send fails and the queue keeps going. Mobile settings command ids are now random per attempt, so a remount no longer replays ids the server already refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main now guards every settings path that detaches a provider session (#35029), so the branch's Orchestrator changes and their tests give way to main's. What main lacks stays: the web branch picker no longer stops the session before the server can refuse a worktree change, and mobile mode changes get a fresh command id per attempt (the queued /compact keeps its stable id so a resend is still deduplicated). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
The automated pipeline stopped on this pull request and will not merge it: the fix is written and reviewed, but proving it needs something no worker has:
It stays open for a person to finish or close. |
Changing a thread's worktree from the web branch picker, or retrying a mode change from a mobile queued send, could end or permanently block a session that still had background agents or shells running. The server already refuses those changes while background work runs; this removes the two client paths that defeated it.
BranchToolbarBranchSelectorno longer stops the thread session before changing its worktree. The server detaches the session itself, and refuses while background work runs.settingsCommandIdgives each runtime-mode and interaction-mode attempt its own command ID, because the server keeps a refusal under its ID and a retry under the same ID could never succeed. The queued/compactkeeps its stable ID so a resend is still deduplicated.Supersedes #24446. The change is @juliusmarminge's; their commits are kept.
Reproduction on main
On mobile, open a Claude thread in Full access and ask it to launch a native background Agent that continues after the parent turn completes. While that Agent is running, select Auto-accept edits and send a message, causing the outbox's runtime-mode synchronization to be refused. Let the Agent finish and allow delivery to retry, including reopening the thread or app: main reuses the rejected settings-command ID, whereas this change supplies a fresh ID so synchronization and delivery can proceed. These are code-derived steps, not an executed reproduction.
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src/state/threadOutboxDelivery.permissions.test.ts(apps/mobile): 24 passed; the new case fails with the old fixed ID (1 failed, 23 passed)vp run check:changed: format, lint, knip, typecheck (3 packages), tests (2 files) and React compiler all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.